#ifndef MODULEMANIFEST_H
#define MODULEMANIFEST_H

#include <QObject>
#include <QFile>
#include <QMap>
#include <QDomNamedNodeMap>


struct node_settings
{
    QString visible;
    QString label;
    QString node_name;
    QString value;
};

typedef QList<node_settings> SettingsList;

class ModuleManifest : public QObject
{
    Q_OBJECT
public:
    explicit ModuleManifest(QObject *parent = 0);

    virtual bool Load(const QString ModuleDirectory);
    virtual void SetEnabled(const bool Enabled);
    virtual bool Enabled();
    virtual const QString Name();
    virtual const QString Version();
    virtual const QString Path();
    virtual const QString ManifestPath();
    virtual const QString LastError();
    virtual const SettingsList Settings();
    
protected:
    QString name;
    QString version;
    QString path;
    QString manifestPath;
    QString lastError;
    bool enabled;
    SettingsList settings;

    bool loadManifest();
    bool loadXML(QFile* XmlFile);
    
};

typedef QList<ModuleManifest*> ModuleList;

#endif // MODULEMANIFEST_H
